The present invention relates to an image processing apparatus and method for assigning colors used in input image data to colors which can be output from an output device.
FIG. 28 shows an example of the pixel arrangement of a conventional 16-color display. As shown in FIG. 28, one pixel is constituted by four subpixels of red, green, blue, and white. Each subpixel takes a value of 1 (ON) or 0 (OFF). By combining these subpixels, 16 colors as shown in FIG. 29 can be expressed.
When it is assumed that, in general color image data, each of R, G, and B components per pixel can take 256 values, 16,777,216 colors can be expressed. When this color image data is to be displayed on the above 16-color display, the colors must be converted into colors expressible on the 16-color display because the colors used in the image data cannot be directly expressed.
In a conventional image processing apparatus for realizing the above-described color conversion, the following color conversion techniques are used depending on application purposes.
For color image data consisting of text data using a small number of colors, simple quantization processing is performed to convert the colors used in the image data into colors expressible on the 16-color display. More specifically, colors used in the image data are converted into colors expressible on the 16-color display on the basis of upper bits of R, G, and B values. As a specific example, color conversion using this technique for the 16-color display shown in FIG. 28 will be described with reference to FIG. 30. Assume that each of R, G, and B values as color components of color image data is represented by 8 bits. As shown in FIG. 30, the uppermost bits of the R, G, and B values are made to correspond to red, green, and blue subpixels constituting one pixel of the 16-color display, respectively. Additionally, the majority of second upper bits of the R, G, and B values is made to correspond to the white subpixel. This processing is executed for each pixel, thereby converting colors used in the image data into colors expressible on the 16-color display.
Color image data of, e.g., a halftone image such as a photograph using a relatively large number of colors is subjected to pseudo halftone processing known as dithering or error diffusion in units of R, G, and B values to abundantly express the halftone. With this processing, colors used in the color image data are converted into colors expressible on the 16-color display.
In the conventional image processing apparatus, however, when color conversion is performed for color image data of a map, a graph, or a CAD having pieces of graphic or character information distinguished using a plurality of colors, the following problems are posed.
When colors used in color image data are converted into colors expressible on the 16-color display on the basis of upper bits of R, G, and B values, i.e., the color components of the color image data, lower bits are omitted, and another color may be assigned to a given color. For this reason, pieces of information distinguished using a plurality of colors cannot be properly distinguished.
FIG. 31 is a view showing the relationship between colors used in color image data and conversion results obtained upon performing color conversion described in FIG. 30. As shown in FIG. 31, colors used in the color image data before color conversion are classified into 16 colors. After color conversion, white, black, dark red, dark blue, and dark magenta are overlappingly assigned to the 16 colors. When color image data obtained by this color conversion is displayed on the 16-color display, only 10 colors are expressed.
When pseudo halftone processing is performed to convert colors used in color image data into those expressible on the 16-color display, a unique dot pattern is generated upon color conversion. When color image data obtained by this color conversion is displayed on the 16-color display, especially pieces of graphic or character information which are distinguished using a plurality of colors can hardly be distinguished.
The present invention has been made in consideration of the above problems, and has as its object to provide an image processing apparatus and method which allow to clearly output lines or characters in input image data when colors used in the input image data are assigned to colors which can be output from an output device, and also allow to output properly distinguishable colors.
In order to achieve the above object, according to the present invention, there is provided an image processing apparatus for assigning colors used in input image data to colors which can be output from an output device, comprising:
classification means for classifying the colors used in the input image data as achromatic colors or chromatic colors on the basis of saturations of the colors used in the input image data;
first assignment means for assigning, on the basis of lightnesses of the colors classified as the achromatic colors by the classification means, achromatic colors which can be output from the output device to the colors classified as the achromatic colors; and
second assignment means for assigning, on the basis of hues of the colors classified as the chromatic colors by the classification means, chromatic colors which can be output from the output device to the colors classified as the chromatic colors.
In order to achieve the above object, according to the present invention, there is also provided an image processing method of assigning colors used in input image data to colors which can be output from an output device, comprising:
the classification step of classifying the colors used in the input image data as achromatic colors or chromatic colors on the basis of saturations of the colors used in the input image data;
the first assignment step of assigning, on the basis of lightnesses of the colors classified as the achromatic colors in the classification step, achromatic colors which can be output from the output device to the colors classified as the achromatic colors; and
the second assignment step of assigning, on the basis of hues of the colors classified as the chromatic colors in the classification step, chromatic colors which can be output from the output device to the colors classified as the chromatic colors.
In order to achieve the above object, according to the present invention, there is also provided a computer-readable memory which stores program codes of image processing, comprising:
a program code of the classification step of classifying colors used in input image data as achromatic colors or chromatic colors on the basis of saturations of the colors used in the input image data;
a program code of the first assignment step of assigning, on the basis of lightnesses of the colors classified as the achromatic colors in the classification step, achromatic colors which can be output from an output device to the colors classified as the achromatic colors; and
a program code of the second assignment step of assigning, on the basis of hues of the colors classified as the chromatic colors in the classification step, chromatic colors which can be output from the output device to the colors classified as the chromatic colors.
According to the present invention having the above arrangement, an image processing apparatus and method which allow to clearly output lines or characters in input image data when colors used in the input image data are assigned to colors which can be output from an output device, and also allow to output properly distinguishable colors can be provided.
Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.